class Tagging < ActiveRecord::Base
  belongs_to :tag
  belongs_to :taggable, :polymorphic => true
  
  def self.add(tag_id, taggable)
    Tagging.new(
      :tag_id => tag_id,
      :taggable_id => taggable.id,
      :taggable_type => taggable.class.to_s
    ).save
  end
end
